package com.zhuoyue.biz.core.command.cmd.common.faa.base;

/**
 * 模式对应参数枚举
 *
 * @author wjming
 */
public enum ModeEnum {
    //烘干
    DRYING("DRYING", "01"),
    //风干
    AIR_DRY("AIR_DRY", "02"),
    //消毒
    DISINFECT("DISINFECT", "04"),
    //负离子
    NAI("NAI", "08");
    private String mode;
    private String command;

    ModeEnum(String mode, String command) {
        this.mode = mode;
        this.command = command;
    }

    public String getMode() {
        return mode;
    }

    public String getCommand() {
        return command;
    }

    /**
     * 根据Key得到枚举的Value
     * 普通for循环遍历，比较判断
     *
     * @param key
     * @return
     */
    public static String getEnumCmd(String key) {
        ModeEnum[] alarmGrades = ModeEnum.values();
        for (int i = 0; i < alarmGrades.length; i++) {
            if (alarmGrades[i].getMode().equals(key)) {
                return alarmGrades[i].getCommand();
            }
        }
        return "";
    }

}
